'use strict';

angular.module('com.dcos.app').factory('WorkFlowCreateService', function ($http) {
	return {
		init: function (project_id,p_id) {
	      return $http({
	        method: 'POST',
	        url:'/api/workflow/list',
	        data:JSON.stringify({project_id:project_id,p_id:p_id}),
	        headers: {'Content-type': 'application/json','Accept': 'application/json'}
	      })
	    },
		save: function (data) {
	      return $http({
	        method: 'POST',
	        url:'/api/workflow/savejob',
	        data: JSON.stringify(data),
	        headers: {'Content-type': 'application/json','Accept': 'application/json'}
	      })
//			var date = new Date();
//			var ms = 10*3600*1000;
//			date.setTime(date.getTime() + ms);
//			document.cookie = "test1=dzl;expires="+date.toGMTString();
			
	    }
	}
});
